package cn.glenn._08security.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ResourceController {
    @GetMapping("/api/public/hello")
    public String helloPublic() {
        return "Hello World-public";
    }

    @GetMapping("/api/private/hello")
    @PreAuthorize("hasAuthority('sys:private:view')")
    public String helloPrivate() {
        return "Hello World-private";
    }
}
